package com.simba.server.jsonservice.serivces;

import com.simba.common.jsonservice.JsonService;
import com.simba.common.log.LogUtil;
import com.simba.server.components.SlotManager;
import org.apache.log4j.Logger;
import org.jboss.netty.channel.Channel;

/**
 * @author create by kavin
 * @date 2020/8/28 2:09
 */
public class ScreenSlotInitJsonService implements JsonService {
    public static final String NAME = "ScreenSlotInit";
    private final static Logger logger = Logger.getLogger(ScreenSlotInitJsonService.class);

    @Override
    public void handleRequest(Channel channel, Object content)
    {
        try
        {
            SlotManager.getInstance().registerSlotScreen(channel);
            SlotManager .getInstance().sendSlotInfoToScreen(null);
        }
        catch (Exception e)
        {
            LogUtil.LogError(ScreenSlotInitJsonService.logger, "Slot Info Json Service Error : exception info : "+e.getMessage());
        }
    }
}
